'use strict';

module.exports = app => {
  class Controller extends app.Controller {
    async chat() {
      const arg = this.ctx.args[0];
      const date = new Date();
      const hour = date.getHours();
      const miute = date.getMinutes();
      const second = date.getSeconds();
      this.ctx.socket.in(arg.roomnum).emit('accept', { speaker: arg.speaker, news: arg.news, date: hour + ':' + miute + ':' + second });// 发送系统消息
    }
  }

  return Controller;
};
